package com.bwie;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2025/6/1 18:34
 */

public class Book {
    // 图书编号
    private String id;
    // 书名
    private String title;
    // 作者
    private String author;
    // 出版社
    private String publisher;

    // 无参构造器
    public Book() {
    }

    // 全参构造器
    public Book(String id, String title, String author, String publisher) {
        this.id = id;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
    }

    // Getter 和 Setter 方法
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    // 可选：重写toString方法便于打印对象信息
    @Override
    public String toString() {
        return "Book{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", publisher='" + publisher + '\'' +
                '}';
    }
}
